import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers'
// import postCssPxToRem from 'postcss-pxtorem'
const path = require('path')
// https://vitejs.dev/config/
export default defineConfig({
	base: './',
	publicDir: '/public',
	plugins: [
		vue(),
		Components({
			resolvers: [AntDesignVueResolver()],
		}),
	],
	resolve: {
		alias: {
			'@': path.resolve(__dirname, 'src'),
		},
	},
	css: {
		postcss: {
			plugins: [
				// postCssPxToRem({
				// 	rootValue: 120,
				// 	propList: ['*'],
				// }),
			],
		},
	},
	// server: {
	// 	proxy: {
	// 		'/api': {
	// 			target: 'http://www.baidu.com/',
	// 			pathRewrite: { '^/api': '' },
	// 			changeOrigin: true, // target是域名的话，需要这个参数，
	// 			secure: false, // 设置支持https协议的代理
	// 		},
	// 	},
	// },
})
